<template>
  <div class="home_container">
    <el-container>
      <el-aside width="200px">
        <div class="logo_container">
          <img src="logo.png" alt="">
        </div>
        <!-- 侧边导航 -->
        <el-menu
          default-active="2"
          class="el-menu-vertical-demo"
          @open="handleOpen"
          @close="handleClose"
          background-color="#334256"
          text-color="#fff"
          router
          :collapse="isCollapse"
          active-text-color="#ffd04b">
          <el-submenu index="1">
            <template slot="title">
              <i class="el-icon-location"></i>
              <span>基础管理</span>
            </template>
            <el-menu-item index="/">商品管理</el-menu-item>
          </el-submenu>
          <el-submenu index="2">
            <template slot="title">
              <i class="el-icon-location"></i>
              <span>订单管理</span>
            </template>
            <el-menu-item index="/jiaoyi">交易订单</el-menu-item>
          </el-submenu>
          <el-submenu index="3">
            <template slot="title">
              <i class="el-icon-location"></i>
              <span>系统管理</span>
            </template>
            <el-menu-item index="/yonghu">用户管理</el-menu-item>
            <el-menu-item index="/caidan">菜单管理</el-menu-item>
          </el-submenu>
          <el-submenu index="4">
            <template slot="title">
              <i class="el-icon-location"></i>
              <span>支付管理</span>
            </template>
            <el-menu-item index="/zhufu">支付配置信息</el-menu-item>
            <el-menu-item index="/peuzhi">支付配置</el-menu-item>
          </el-submenu>
        </el-menu>
      </el-aside>
      <el-container>
        <el-header>
          <div class="openClose">
            <img src="openClose.jpeg" @click="openClose">
          </div>
          <!-- <div class="exit"> -->
            <el-dropdown>
              <span class="el-dropdown-link">
                下拉菜单<i class="el-icon-arrow-down el-icon--right"></i>
              </span>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item>设置</el-dropdown-item>
                <el-dropdown-item>退出</el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>
          <!-- </div> -->
        </el-header>
        <el-main>
          <router-view/>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  data(){
    return{
      isCollapse:false
    }
  },
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
    openClose(){
      console.log("openClose")
      this.isCollapse = !this.isCollapse;
    }
  }
}
</script>

<style scoped>

.el-dropdown-link {
    cursor: pointer;
    color: #fff;
}
.el-icon-arrow-down {
  font-size: 12px;
}

.openClose
{
  height: 9vh;
  width: 100px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  /* background-color: #fff; */
}

.el-submenu
{
  border: none;
}

.openClose img
{
  width: 25px;
  height: 24px;
  cursor: pointer;
}

.home_container
{
  width: 100vw;
  height: 100vh;
}

  .el-header {
    background-color: #334256;
    display: inline-flex;
    justify-content: space-between;
    padding: 0 10px;
    box-sizing: border-box;
    align-items: center;
  }
  
  .el-aside {
    background-color: #334256;
    height: 100vh;
  }
  
  .logo_container
  {
    width: 200px;
    height: 15vh;
    justify-content: center;
    align-items: center;
    display: inline-flex;
  }

  .logo_container img
  {
    width: 200px;
    height: auto;
  }
  .el-main {
    background-color: #fff;
  }
  
</style>